#include <iostream>
#include <string>
using namespace std;

int main()
{
    int n = 0;
    while (cin >> n)
    {
        getchar();
        while (n)
        {
            --n;
            string str;
            getline(cin, str);
            if (str.find(' ') == -1 && str.find(',') == -1)
            {
                if (n == 0)
                {
                    cout << str;
                    break;
                }

                cout << str << ", ";
            }
            else
            {
                if (n == 0)
                {
                    cout << '"' << str << '"';
                    break;
                }

                cout << '"' << str << '"' << ", ";
            }
        }
        cout << endl;
    }

    return 0;
}